from gettoken import Token
from faker import Faker
f = Faker(locale='zh-CN') #

class add_address(Token):
    path = 'api/user_address/add'

    def send(self):
        mydata = {
        "contact":f.name(),
        "telephone":f.phone_number(),
        "province_id":130000,
        "city_id":130100,
        "district_id":130105,
        "address":f.address(),
        "is_default":0
        }
        res = self.huihua.post(url=self.hosturl+self.path,data=mydata,headers=self.make_header())
        print(res.json())

if __name__ == '__main__':
    import requests
    r = requests.session()
    t = add_address(r)
    t.send()